home *** CD-ROM | disk | FTP | other *** search
/ Creating Your Own America Online Web Pages / Creating Your Own America Online Web Pages.iso / TOOLS / TEX2RTF / SOURCES.ZIP / SRC / WXWIN / COMMON.H next >
Encoding:
C/C++ Source or Header  |  1994-02-07  |  10.7 KB  |  337 lines

  1. /*
  2.  * File:     common.h
  3.  * Purpose:  Declarations/definitions common to all wx source files
  4.  *
  5.  *                       wxWindows 1.50
  6.  * Copyright (c) 1993 Artificial Intelligence Applications Institute,
  7.  *                   The University of Edinburgh
  8.  *
  9.  *                     Author: Julian Smart
  10.  *                       Date: 7-9-93
  11.  *
  12.  * Permission to use, copy, modify, and distribute this software and its
  13.  * documentation for any purpose is hereby granted without fee, provided
  14.  * that the above copyright notice, author statement and this permission
  15.  * notice appear in all copies of this software and related documentation.
  16.  *
  17.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS,
  18.  * IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
  19.  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  20.  *
  21.  * IN NO EVENT SHALL THE ARTIFICIAL INTELLIGENCE APPLICATIONS INSTITUTE OR THE
  22.  * UNIVERSITY OF EDINBURGH BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR
  23.  * CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM
  24.  * LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF
  25.  * DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH
  26.  * THE USE OR PERFORMANCE OF THIS SOFTWARE.
  27.  */
  28.  
  29. #ifndef wxb_commonh
  30. #define wxb_commonh
  31.  
  32. #include <stddef.h>
  33. #include <string.h>
  34.  
  35. #ifdef wx_xview
  36. #define wx_x
  37. #endif
  38.  
  39. #ifdef wx_motif
  40. #define wx_x
  41. #endif
  42.  
  43. #ifdef wx_x
  44. typedef int Bool;
  45. #define TRUE 1
  46. #define FALSE 0
  47. #endif
  48.  
  49. #if (defined(wx_msw) || defined(wx_dos))
  50. #ifndef Bool
  51. typedef int Bool;
  52. #endif
  53. #ifndef TRUE
  54. #define TRUE  1
  55. #define FALSE 0
  56. #endif
  57. #endif
  58.  
  59. typedef short int WXTYPE;
  60.  
  61. // Styles for wxListBox - Yes, all in Multiple , and nothing in Style
  62. #define wxMULTIPLE_MASK    0x03
  63. #define wxSINGLE           0x00
  64. #define wxMULTIPLE         0x01
  65. #define wxEXTENDED         0x02
  66.  
  67. #define wxSB_MASK          0x08
  68. #define wxNEEDED_SB        0x00
  69. #define wxALWAYS_SB        0x08
  70.  
  71. // Frame/dialog/subwindow style flags
  72. #define wxVSCROLL          1
  73. #define wxHSCROLL          2
  74. #define wxCAPTION          4
  75. #define wxABSOLUTE_POSITIONING 8 // Hint to Windowing system not to try anything clever
  76.  
  77. // Frame/dialog style flags
  78. #define wxSTAY_ON_TOP      8
  79. #define wxICONIZE          16
  80. #define wxMINIMIZE         wxICONIZE
  81. #define wxMAXIMIZE         32
  82. #define wxSDI              64
  83. #define wxMDI_PARENT       128
  84. #define wxMDI_CHILD        256
  85. #define wxTHICK_FRAME      512
  86. #define wxSYSTEM_MENU      1024
  87. #define wxMINIMIZE_BOX     2048
  88. #define wxMAXIMIZE_BOX     4096
  89. #define wxDEFAULT_FRAME    (wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION)
  90.  
  91. // Subwindow style flags
  92. #define wxBORDER           64
  93. #define wxRETAINED         128
  94.  
  95. //This style is intended for wxCanvas only -- Then this value could probably
  96. // have another (lower) value ??
  97. // [I choose 16384 because it seems to be never used]
  98. // Please note that this is NOT the same thing as wxRETAINED, and this
  99. // use backing store capability (if any) of the X server.
  100. // Backing store is fully transparent to the application.
  101. #ifndef wx_motif
  102. #define       wxBACKINGSTORE     0
  103. #else
  104. #define       wxBACKINGSTORE     16384
  105. #endif
  106.  
  107. //This style is intended for wxDialogBox only -- Then this value could probably
  108. // have another (lower) value ??
  109. // [I choose 32768 because it seems to be never used]
  110. // This flag is used by XView, to create FRAME or FRAME_CMD dialog box.
  111. // no effect on other architectures.
  112. #ifndef wx_xview
  113. #define       wxXVIEW_CMD     0
  114. #else
  115. #define       wxXVIEW_CMD     32768
  116. #endif
  117.  
  118. // This style is intended for wxDialogBox only -- Then this value could probably
  119. // have another (lower) value ??
  120. // [I choose 65536 because it seems to be never used]
  121. // This flag is used by Motif, for shell resize policy
  122. // no effect on other architectures.
  123. // Default policy is controlled by MOTIF_MANAGE, which can be defined at
  124. // compile time.
  125. #ifndef wx_motif
  126. #define       wxMOTIF_RESIZE     0
  127. #else
  128. #define       wxMOTIF_RESIZE     65536
  129. #endif
  130.  
  131. #ifdef MOTIF_MANAGE
  132. #define DEFAULT_DIALOG_STYLE    wxMOTIF_RESIZE
  133. #else
  134. #define DEFAULT_DIALOG_STYLE    0
  135. #endif
  136.  
  137.  
  138. #ifndef wx_motif
  139. #define       wxFLAT          wxBORDER
  140. #else
  141. #define       wxFLAT          256
  142. #endif
  143.  
  144. // Text font families
  145. #define wxDEFAULT          70
  146. #define wxDECORATIVE       71
  147. #define wxROMAN            72
  148. #define wxSCRIPT           73
  149. #define wxSWISS            74
  150. #define wxMODERN           75
  151.  
  152. #define wxVARIABLE         80
  153. #define wxFIXED            81
  154.  
  155. // Text font weight
  156. #define wxNORMAL           90
  157. #define wxLIGHT            91
  158. #define wxBOLD             92
  159.  
  160. // Text font style
  161. // Also wxNORMAL for normal (non-italic text)
  162. #define wxITALIC           93
  163. #define wxSLANT            94
  164.  
  165. // Pen styles
  166. #define wxSOLID            100
  167. #define wxDOT              101
  168. #define wxLONG_DASH        102
  169. #define wxSHORT_DASH       103
  170. #define wxDOT_DASH         104
  171. #define    wxUSER_DASH        105
  172.  
  173. #define wxTRANSPARENT      106
  174.  
  175. #define wxJOIN_BEVEL       120
  176. #define wxJOIN_MITER       121
  177. #define wxJOIN_ROUND       122
  178.  
  179. #define wxCAP_ROUND        130
  180. #define wxCAP_PROJECTING   131
  181. #define wxCAP_BUTT         132
  182.  
  183. // Brush & Pen Stippling. Note that a stippled pen cannot be dashed!!
  184. // Note also that stippling a Pen IS meaningfull, because a Line is
  185. // drawed with a Pen, and without any Brush -- and she can be stippled.
  186.  
  187. // Note also that there is a big diff between X stipple and Windows:
  188. // On X, stipple is a mask between the wxBitmap and current colour,
  189. // On Windows, current colour is ignored, and bitmap colour is used.
  190. // However, for pre-defined modes like wxCROSS_HATCH,... behavior is the
  191. // same on both platforms.
  192.  
  193. #define wxSTIPPLE          110
  194. #define    wxBDIAGONAL_HATCH  111
  195. #define wxCROSSDIAG_HATCH  112
  196. #define wxFDIAGONAL_HATCH  113
  197. #define wxCROSS_HATCH      114
  198. #define wxHORIZONTAL_HATCH 115
  199. #define wxVERTICAL_HATCH   116
  200.  
  201. #define IS_HATCH(s)    ((s)>=wxBDIAGONAL_HATCH && (s)<=wxVERTICAL_HATCH)
  202.  
  203. // Logical ops
  204. #define wxCLEAR            0      // 0
  205. #define wxXOR              1      // src XOR dst
  206. #define wxINVERT           2      // NOT dst
  207. #define wxOR_REVERSE       3      // src OR (NOT dst)
  208. #define wxAND_REVERSE      4      // src AND (NOT dst)
  209. #define wxCOPY             5      // src
  210. #define wxAND              6      // src AND dst
  211. #define wxAND_INVERT       7      // (NOT src) AND dst
  212. #define wxNO_OP            8      // dst
  213. #define wxNOR              9      // (NOT src) AND (NOT dst)
  214. #define wxEQUIV            10     // (NOT src) XOR dst
  215. #define wxSRC_INVERT       11     // (NOT src)
  216. #define wxOR_INVERT        12     // (NOT src) OR dst
  217. #define wxNAND             13     // (NOT src) OR (NOT dst)
  218. #define wxOR               14     // src OR dst
  219. #define wxSET              15     // 1
  220.  
  221. // Directions
  222. #define wxHORIZONTAL      1
  223. #define wxVERTICAL        2
  224. #define wxBOTH            3
  225.  
  226. // Dialog specifiers/return values
  227. #define wxOK                     1
  228. #define wxYES_NO                 2
  229. #define wxCANCEL                 4
  230. #define wxYES                    8
  231. #define wxNO                    16
  232.  
  233. #define wxICON_EXCLAMATION      32
  234. #define wxICON_HAND             64
  235. #define wxICON_QUESTION        128
  236.  
  237. // Clipboard formats
  238. #ifdef wx_msw
  239. #define wxCF_TEXT               CF_TEXT
  240. #define wxCF_BITMAP             CF_BITMAP
  241. #define wxCF_METAFILE           CF_METAFILEPICT
  242. #define wxCF_DIB                CF_DIB
  243. #define wxCF_OEMTEXT            CF_OEMTEXT
  244. #else
  245. #define wxCF_TEXT               1
  246. #define wxCF_BITMAP             2
  247. #define wxCF_METAFILE           3
  248. #define wxCF_DIB                4
  249. #define wxCF_OEMTEXT            5
  250. #endif
  251.  
  252. // Virtual keycodes
  253. #define WXK_START           300
  254.  
  255. #define WXK_LBUTTON        (WXK_START + 1)
  256. #define WXK_RBUTTON        (WXK_START + 2)
  257. #define WXK_CANCEL        (WXK_START + 3)
  258. #define WXK_MBUTTON          (WXK_START + 4)
  259. #define WXK_BACK         8
  260. #define WXK_TAB            9
  261. #define WXK_CLEAR        (WXK_START + 5)
  262. #define WXK_RETURN        13
  263. #define WXK_SHIFT        (WXK_START + 6)
  264. #define WXK_CONTROL        (WXK_START + 7)
  265. #define WXK_MENU         (WXK_START + 8)
  266. #define WXK_PAUSE        (WXK_START + 9)
  267. #define WXK_CAPITAL        (WXK_START + 10)
  268. #define WXK_ESCAPE        27
  269. #define WXK_SPACE        32
  270. #define WXK_PRIOR        (WXK_START + 11)
  271. #define WXK_NEXT         (WXK_START + 12)
  272. #define WXK_END            (WXK_START + 13)
  273. #define WXK_HOME         (WXK_START + 14)
  274. #define WXK_LEFT         (WXK_START + 15)
  275. #define WXK_UP            (WXK_START + 16)
  276. #define WXK_RIGHT        (WXK_START + 17)
  277. #define WXK_DOWN         (WXK_START + 18)
  278. #define WXK_SELECT        (WXK_START + 20)
  279. #define WXK_PRINT        (WXK_START + 21)
  280. #define WXK_EXECUTE        (WXK_START + 22)
  281. #define WXK_SNAPSHOT        (WXK_START + 23)
  282. #define WXK_INSERT        (WXK_START + 24)
  283. #define WXK_DELETE        127
  284. #define WXK_HELP         (WXK_START + 25)
  285. #define WXK_NUMPAD0        (WXK_START + 26)
  286. #define WXK_NUMPAD1        (WXK_START + 27)
  287. #define WXK_NUMPAD2        (WXK_START + 28)
  288. #define WXK_NUMPAD3        (WXK_START + 29)
  289. #define WXK_NUMPAD4        (WXK_START + 30)
  290. #define WXK_NUMPAD5        (WXK_START + 31)
  291. #define WXK_NUMPAD6        (WXK_START + 32)
  292. #define WXK_NUMPAD7        (WXK_START + 33)
  293. #define WXK_NUMPAD8        (WXK_START + 34)
  294. #define WXK_NUMPAD9        (WXK_START + 35)
  295. #define WXK_MULTIPLY        (WXK_START + 36)
  296. #define WXK_ADD            (WXK_START + 37)
  297. #define WXK_SEPARATOR        (WXK_START + 38)
  298. #define WXK_SUBTRACT        (WXK_START + 39)
  299. #define WXK_DECIMAL        (WXK_START + 40)
  300. #define WXK_DIVIDE        (WXK_START + 41)
  301. #define WXK_F1            (WXK_START + 42)
  302. #define WXK_F2            (WXK_START + 43)
  303. #define WXK_F3            (WXK_START + 44)
  304. #define WXK_F4            (WXK_START + 45)
  305. #define WXK_F5            (WXK_START + 46)
  306. #define WXK_F6            (WXK_START + 47)
  307. #define WXK_F7            (WXK_START + 48)
  308. #define WXK_F8            (WXK_START + 49)
  309. #define WXK_F9            (WXK_START + 50)
  310. #define WXK_F10            (WXK_START + 51)
  311. #define WXK_F11            (WXK_START + 52)
  312. #define WXK_F12            (WXK_START + 53)
  313. #define WXK_F13            (WXK_START + 54)
  314. #define WXK_F14            (WXK_START + 55)
  315. #define WXK_F15            (WXK_START + 56)
  316. #define WXK_F16            (WXK_START + 57)
  317. #define WXK_F17            (WXK_START + 58)
  318. #define WXK_F18            (WXK_START + 59)
  319. #define WXK_F19            (WXK_START + 60)
  320. #define WXK_F20            (WXK_START + 61)
  321. #define WXK_F21            (WXK_START + 62)
  322. #define WXK_F22            (WXK_START + 63)
  323. #define WXK_F23            (WXK_START + 64)
  324. #define WXK_F24            (WXK_START + 65)
  325. #define WXK_NUMLOCK        (WXK_START + 66)
  326. #define WXK_SCROLL           (WXK_START + 67)
  327.  
  328. // Colours - see wx_gdi.cc for database
  329.  
  330. #define wxTYPE_ANY           0
  331. #define wxTYPE_NODE          1
  332. #define wxTYPE_LIST          2
  333. #define wxTYPE_STRING_LIST   3
  334. #define wxTYPE_HASH_TABLE    4
  335.  
  336. #endif // wxb_commonh
  337.